
#region Imports

using System;

#endregion

namespace Justa.Common
{
    /// <summary>
    /// 
    /// </summary>
    /// 
    /// <author>Abel Perez (java.aperez@gmail.com)</author>
    /// 
    public sealed class ArgumentValidator
    {
        /// <summary>
        /// Prevent direct instantiation.
        /// </summary>
        /// 
        private ArgumentValidator()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <param name="target"></param>
        /// <param name="targetName"></param>
        /// 
        public static void Validate(object target, string targetName)
        {
            if (null == target)
            {
                throw new ArgumentException(string.Format("Specified parameter: {0} is null.", targetName));
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// 
        /// <param name="target"></param>
        /// <param name="targetName"></param>
        /// 
        public static void ValidateString(object target, string targetName)
        {
            if (null == target || String.Empty.Equals(target))
            {
                throw new ArgumentException(string.Format("Specified parameter: {0} is null.", targetName));
            }
        }
    }
}
